{include file="public/header"}
<div id="indexMain">
    <div class="pub_wid notice_cont">
        <div class="lf bgb member_box one_floor">
            <h1>最新注册会员<span>Member</span><br />
                <img src="/static/index/public/images/h1_bg.png" /></h1>
            <ul class="widthauto new_ul">
                <li v-for="item in memberInfoList"><a :href="'/index/enterprise/detail/id/'+item.id" v-text="item.name"></a></li>
<!--                <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
            </ul>
            <h6><a href="/index/enterprise/index">更多></a></h6>
        </div>
        <div class="banner one_floor">
            <!-- Swiper -->
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide" v-if="bannerList.length>0" v-for="item in bannerList">
                        <a :href="item.link_url" target="_blank"><img :src="item.image_url" /></a>
                    </div>
                    <div class="swiper-slide" v-if="bannerList.length==0">
<!--                        <a href="#"><img src="/static/index/public/images/banner_001.jpg" /></a>-->
                    </div>
<!--                    <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/banner_001.jpg" /></a></div>-->
<!--                    <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/banner_001.jpg" /></a></div>-->
<!--                    <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/banner_001.jpg" /></a></div>-->
                </div>
                <!-- Add Pagination -->
                <div class="swiper-pagination"></div>
            </div>

            <!-- Swiper JS -->


            <!-- Initialize Swiper -->
        </div>
        <div class="rg bgb notice_box one_floor">
            <h1>最新公告<span>New Notice</span></h1>
            <ul class="widthauto dot_ul">
                <li v-for="item in noticeList"><a :href="'/index/notice/detail/id/'+item.id">{{item.title}}</a></li>
<!--                <li><a href="#">2021年海运滚装运输服务询价采...</a></li>-->
<!--                <li><a href="#">京东2021年城配运输承运商招标</a></li>-->
<!--                <li><a href="#">上海日日辔供应链管理有限公司...</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
            </ul>
            <h6><a href="/index/notice/index">更多></a></h6>
        </div>
    </div>
    <div class="pub_wid two_floor">
        <div class="lf two_left">
            <div class="add_box"> <a :href="advertisingTwo.link_url"><img :src="advertisingTwo.image_url" /></a> </div>
            <div class="lf bgb member_box">
                <h1>承运商推荐<span>Carrier</span><br />
                    <img src="/static/index/public/images/h1_bg.png" /></h1>
                <ul class="widthauto new_ul">
                    <li v-for="item in consignorList"><a :href="'/index/enterprise/detail/id/'+item.id">{{item.name}}</a></li>
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">黑龙江北大仓集团有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">黑龙江北大仓集团有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
                </ul>
                <h6><a href="/index/enterprise/index">更多></a></h6>
            </div>
            <div class="add_box"> <a :href="advertisingThree.link_url"><img :src="advertisingThree.image_url" /></a> </div>
        </div>
        <div class="banner">
            <div class="bgb member_box">
                <h1>最新招标信息<span>Information</span><a href="/index/tender/index">更多></a><br />
                    <img src="/static/index/public/images/h1_bg.png" /></h1>
                <div class="table_head widthauto"> <span class="big">标题</span><span class="sma">行业</span><span class="sma">状态</span> </div>
                <ul class="widthauto middl_ul">
                    <li v-for="item in consignorItemOne">
                        <a :href="'/index/source/detail/id/'+item.id">
                            <span class="big">{{item.province}}<i>|</i>{{item.title}}</span>
                            <span class="sma">{{item.trade_name}}</span>
<!--                            <span class="sma ing">进行中</span>-->
                            <span v-if="item.end_time_status==1" class="sma ing">进行中</span>
                            <span v-if="item.end_time_status==2" class="sma end">已截止</span>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="bgb member_box">
                <h1>实时货源<span>Source of goods</span><a href="/index/source/index">更多></a><br />
                    <img src="/static/index/public/images/h1_bg.png" /></h1>
                <div class="table_head widthauto"> <span class="big">标题</span><span class="sma">行业</span><span class="sma">状态</span> </div>
                <ul class="widthauto middl_ul">
                    <li v-for="item in consignorItemTwo">
                        <a :href="'/index/source/detail/id/'+item.id">
                            <span class="big">{{item.province}}<i>|</i>{{item.title}}</span>
                            <span class="sma">{{item.trade_name}}</span>
<!--                            <span class="sma ing">进行中</span>-->
                            <span v-if="item.end_time_status==1" class="sma ing">进行中</span>
                            <span v-if="item.end_time_status==2" class="sma end">已截止</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="rg two_left">
            <div class="add_box"> <a :href="advertisingFour.link_url"><img :src="advertisingFour.image_url" /></a> </div>
            <div class="lf bgb member_box">
                <h1>行业资讯<span>News</span><br />
                    <img src="/static/index/public/images/h1_bg.png" /></h1>
                <ul class="widthauto dot_ul">
                    <li v-for="item in newsList"><a :href="'/index/news/detail/id/'+item.id">{{item.title}}</a></li>
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
<!--                    <li><a href="#">云南玉溪宏斌绿色食品有限公司</a></li>-->
<!--                    <li><a href="#">浙江友邦集成吊顶有限公司</a></li>-->
                </ul>
                <h6><a href="/index/news/index">更多></a></h6>
            </div>
            <div class="add_box"> <a :href="advertisingFive.link_url"><img :src="advertisingFive.image_url" /></a> </div>
        </div>
    </div>
    <div class="thr_floor pub_wid">
        <div class="bgb member_box">
            <h1>物流企业推荐<span>Recommend</span><a href="/index/enterprise/index">更多></a><br />
                <img src="/static/index/public/images/h1_bg.png" /></h1>
            <div class="recommend widthauto">
                <div class="swiper-containera">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide" v-for="item in logisticsList">
                            <a :href="'/index/enterprise/detail/id/'+item.id"><img style="width: 240px;height: 120px" :src="item.logo" /></a>
                        </div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_007.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_006.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_007.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_006.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_007.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_006.jpg" /></a></div>
                        <div class="swiper-slide"><a href="#"><img src="/static/index/public/images/add_007.jpg" /></a></div>
                    </div>
                    <!-- Add Pagination -->
                    <div class="swiper-paginationa"></div>
                </div>

            </div>
        </div>
    </div>
    <div class="thr_floor pub_wid">
        <div class="bgb member_box">
            <h1>友情链接<span>Links</span><br />
                <img src="/static/index/public/images/h1_bg.png" /></h1>
            <div class="links_box">
                   <span v-for="item in linkList" > <a :href="'http://'+item.link_url" target="_blank">{{item.name}}</a><i>|</i></span>

        </div>
        </div>
    </div>
</div>
{include file="public/footer"}
<script src="/static/index/public/js/swiper-bundle.min.js"></script>
<script>
    var indexVm = new Vue({
        el:'#indexMain',
        data:{
            memberInfoList:[],//最新注册会员
            consignorItemOne:[],//最新招标
            consignorItemTwo:[],//最新实时货源
            newsList:[],//最新资讯
            noticeList:[],//公告
            linkList:[],//外链
            bannerList:[],//banner
            consignorList:[],//货主企业
            logisticsList:[],//物流企业

            advertisingTwo:{},//广告二
            advertisingThree:{},//广告三
            advertisingFour:{},//广告四
            advertisingFive:{},//广告五

        },
        methods:{
            //获取最新注册会员
            getNewMemberList:function () {
                var el = this
                var postData = {
                    'num':10
                }
                AjaxPost(postData,'/index/index/getNewMemberInfoList').then((response=>{
                    if(response.status==1){
                        if(response.result){
                            el.memberInfoList = response.result
                        }
                    }
                }))
            },
            getTime:function (dateString='') {
                var time = ''
                if(dateString==''){
                    time =  new Date()
                }else {
                    time =  new Date(dateString)
                }
                return time.getTime()
            },
            //最新招标
            getConsignorItemOneList:function () {
                var el = this
                var postData = {
                    'num':15,
                    'item_category':1
                }
                AjaxPost(postData,'/index/index/getConsignorItemOneList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            var list = response.result
                            $.each(list,function (j,k) {
                                if(el.getTime(k.end_time)>el.getTime()){
                                    k['end_time_status'] = 1
                                }else{
                                    k['end_time_status'] = 2
                                }
                            })
                            el.consignorItemOne = list
                        }
                    }
                    console.log(response)
                })
            },
            //最新招标
            getConsignorItemTwoList:function () {
                var el = this
                var postData = {
                    'num':15,
                    'item_category':2
                }
                AjaxPost(postData,'/index/index/getConsignorItemOneList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            var list = response.result
                            $.each(list,function (j,k) {
                                if(el.getTime(k.end_time)>el.getTime()){
                                    k['end_time_status'] = 1
                                }else{
                                    k['end_time_status'] = 2
                                }
                            })
                            el.consignorItemTwo = list
                        }
                    }
                })
            },
            //新闻资讯
            getNewsList:function () {
                var el = this
                var postData = {
                    'num':15,
                }
                AjaxPost(postData,'/index/index/getNewsLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.newsList = response.result
                        }
                    }
                })
            },
        //    getNoticeLimitList
            //公告
            getNoticeList:function () {
                var el = this
                var postData = {
                    'num':10,
                }
                AjaxPost(postData,'/index/index/getNoticeLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.noticeList = response.result
                        }
                    }
                })
            },
            //外链
            getLinkList:function () {
                var el = this
                var postData = {
                    'num':10,
                }
                AjaxPost(postData,'/index/index/getLinkLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.linkList = response.result
                        }
                    }
                })
            },
            bannerSwiper:function(){
                var swiper = new Swiper('.swiper-container', {
                    spaceBetween: 30,
                    centeredSlides: true,
                    autoplay: {
                        delay: 2500,
                        disableOnInteraction: false,
                    },
                    pagination: {
                        el: '.swiper-pagination',
                        clickable: true,
                    },
                    navigation: {
                        nextEl: '.swiper-button-next',
                        prevEl: '.swiper-button-prev',
                    },
                    observeParents:true,   //修改swiper自己或子元素时，自动初始化swiper
                    observer:true,
                });
            },
            //获取banner列表
            getBannerList:function () {
                var el = this
                var postData = {
                    'num':10,
                }
                AjaxPost(postData,'/index/index/getBannerLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.bannerList = response.result
                            el.bannerSwiper()
                        }

                    }
                })
            },
            //获取首页显示的货主企业
            getConsignorList:function () {
                var el = this
                var postData = {
                    'num':18,
                }
                AjaxPost(postData,'/index/index/getConsignorLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.consignorList = response.result
                        }
                    }
                })
            },
            //获取首页显示的物流企业
            getLogisticsList:function () {
                var el = this
                var postData = {
                    'num':18,
                }
                AjaxPost(postData,'/index/index/getLogisticsLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.logisticsList = response.result
                        }
                    }
                })
            },
            //获取首页显示广告二
            getAdvertisingTwo:function () {
                var el = this
                var postData = {
                    'id':2,
                }
                AjaxPost(postData,'/index/index/getAdvertisingLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.advertisingTwo = response.result
                        }
                    }
                })
            },
            //获取首页显示广告三
            getAdvertisingThree:function () {
                var el = this
                var postData = {
                    'id':3,
                }
                AjaxPost(postData,'/index/index/getAdvertisingLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.advertisingThree = response.result
                        }
                    }
                })
            },
            //获取首页显示广告四
            getAdvertisingFour:function () {
                var el = this
                var postData = {
                    'id':4,
                }
                AjaxPost(postData,'/index/index/getAdvertisingLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.advertisingFour = response.result
                        }
                    }
                })
            },
            //获取首页显示广告五
            getAdvertisingFive:function () {
                var el = this
                var postData = {
                    'id':5,
                }
                AjaxPost(postData,'/index/index/getAdvertisingLimitList').then((response)=>{
                    if(response.status==1){
                        if(response.result){
                            el.advertisingFive = response.result
                        }
                    }
                    console.log(el.advertisingTwo)
                })
            },
        },
        mounted(){
            this.$nextTick(function () {

                //调取最新会员
                this.getNewMemberList()
                //最新招标
                this.getConsignorItemOneList()
                //实时货源
                this.getConsignorItemTwoList()
                //最新资讯
                this.getNewsList()
                //公告
                this.getNoticeList()
                //外链
                this.getLinkList()
                //banner
                this.getBannerList()
                //货主企业
                this.getConsignorList()
                //物流企业
                this.getLogisticsList()
                //获取广告二
                this.getAdvertisingTwo()
                //获取广告三
                this.getAdvertisingThree()
                //获取广告四
                this.getAdvertisingFour()
                //获取广告五
                this.getAdvertisingFive()
                var swiper = new Swiper('.swiper-containera', {
                    slidesPerView:4.5,
                    spaceBetween: 30,
                    pagination: {
                        el: '.swiper-paginationa',
                        clickable: true,
                    },
                    autoplay: {
                        delay: 2500,
                        disableOnInteraction: false,
                    },
                    observeParents:true,   //修改swiper自己或子元素时，自动初始化swiper
                    observer:true,
                });
            })
        }
    })
</script>